<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /*
            splice 增加
            splice(index,howmany,item)
            从index之后增加，howmany传0
            splice 删除
            splice(index,howmany)
        */
        var arr=[1,2,3];
        arr.splice(2,0,"hello");
        arr.splice(0,2);
        console.log(arr);
    </script>
</body>
</html>